import Vue from 'vue'
import Router from 'vue-router'
import home from '@/components/Home/home'
import login from '@/components/Login/login'
import register from '@/components/Register/register'

Vue.use(Router)

export default new Router({
  // mode: 'history',
  routes: [{
    path: '/',
    name: 'Login',
    component: login
  },

  {
    path: '/register',
    name: 'Register',
    component: register
  },

  {
    path: '/:userName',
    name: 'Home',
    component: home,
    children: [{
      path: 'majorplan',
      name: 'MajorPlan',
      component: () => import('@/components/MajorPlanManage/MajorPlan.vue')
    },
    {
      path: 'majorlibrary',
      name: 'MajorLibrary',
      component: () => import('@/components/MajorPlanManage/MajorLibrary.vue')
    },
    {
      path: 'majorclass',
      name: 'MajorClass',
      component: () => import('@/components/MajorPlanManage/MajorClass.vue')
    },
    {
      path: 'nationmajor',
      name: 'NationMajor',
      component: () => import('@/components/MajorPlanManage/NationMajor.vue')
    },
    {
      path: 'courselibrary',
      name: 'CourseLibrary',
      component: () => import('@/components/MajorPlanManage/CourseLibrary.vue')
    },
    {
      path: 'nationcourse',
      name: 'NationCourse',
      component: () => import('@/components/MajorPlanManage/NationCourse.vue')
    },
    {
      path: 'setmajorcourse',
      name: 'SetMajorCourse',
      component: () => import('@/components/MajorPlanManage/SetMajorCourse.vue')
    },
    {
      path: 'newExamination',
      name: 'NewExamination',
      component: () => import('@/components/ExaminationManagement/NewExamination.vue')
    },
    {
      path: 'examinationList',
      name: 'ExaminationList',
      component: () => import('@/components/ExaminationManagement/ExaminationList.vue')
    },
    {
      path: 'examinationEdit',
      name: 'ExaminationEdit',
      component: () => import('@/components/ExaminationManagement/ExaminationEdit.vue')
    },
    {
      path: 'examSessionWithoutCourse',
      name: 'ExamSessionWithoutCourse',
      component: () => import('@/components/ExamPlanManagement/ExamSessionWithoutCourse.vue')
    },
    {
      path: 'newExamPlan',
      name: 'NewExamPlan',
      component: () => import('@/components/ExamPlanManagement/NewExamPlan.vue')
    },
    {
      path: 'newExamCourse',
      name: 'NewExamCourse',
      component: () => import('@/components/ExamPlanManagement/NewExamCourse.vue')
    },
    {
      path: 'examSessionWithoutPlan',
      name: 'ExamSessionWithoutPlan',
      component: () => import('@/components/ExamPlanManagement/ExamSessionWithoutPlan.vue')
    },
    {
      path: 'checkPlan',
      name: 'CheckPlan',
      component: () => import('@/components/ExamPlanManagement/CheckPlan.vue')
    },
    {
      path: 'examOpeningCourseSummary',
      name: 'ExamOpeningCourseSummary',
      component: () => import('@/components/ExamPlanManagement/ExamOpeningCourseSummary.vue')
    },
    {
      path: 'escList',
      name: 'ESCList',
      component: () => import('@/components/ExamPlanManagement/ESCList.vue')
    },
    {
      path: 'examCourseSummary',
      name: 'ExamCourseSummary',
      component: () => import('@/components/ExamPlanManagement/ExamCourseSummary.vue')
    },
    {
      path: 'examsProfessionalCoursesStatistics',
      name: 'ExamsProfessionalCoursesStatistics',
      component: () => import('@/components/ExamPlanManagement/ExamsProfessionalCoursesStatistics.vue')
    },
    {
      path: 'newMajorDeclaration',
      name: 'NewMajorDeclaration',
      component: () => import('@/components/MajorDeclaration/NewMajorDeclaration.vue')
    },
    {
      path: 'newMajorCheck',
      name: 'NewMajorCheck',
      component: () => import('@/components/MajorDeclaration/NewMajorCheck.vue')
    },
    {
      path: 'newMajor',
      name: 'NewMajor',
      component: () => import('@/components/MajorDeclaration/NewMajor.vue')
    }
    ]
  }

  ]
})
